﻿using System;

namespace ZYCommon
{

    public class Format_Min : StringDataFormatItem
    {
        public override bool CanEditSetting()
        {
            return true;
        }

        public override bool Test(string strValue)
        {
            return (Convert.ToDouble(strValue) >= Convert.ToDouble(base.strSetting));
        }

        public override string DisplayName
        {
            get
            {
                return ("最小不得小于" + base.strSetting);
            }
        }

        public override string Name
        {
            get
            {
                return "min";
            }
        }

        public override string SettingValue
        {
            get
            {
                return base.strSetting;
            }
            set
            {
                if (value == null)
                {
                    base.strSetting = "0";
                }
                else
                {
                    try
                    {
                        Convert.ToDouble(value);
                        base.strSetting = value;
                    }
                    catch
                    {
                    }
                }
            }
        }
    }
}

